<?php if($model->{$name}):?>
<table>
	<tr>
		<td><?php echo CHtml::image($options['image'], $title, array('class'=>'bordered')); ?></td>
		<td>
			<span id="upload_<?php echo $id; ?>">
				<?php echo CActiveForm::fileField($model,'_'.$id); ?>
				<?php echo CHtml::hiddenField('delete_'.$id, '0', array('id'=>'del_'.$id)); ?>
			</span>
			<?php if($options['delete']): ?>
			<br />
			<?php echo CHtml::button('Удалить', array('onclick' => 'return deleteImageForm();'));?>
			<?php endif; ?>
		</td>
	</tr>
</table>
<?php else: ?>
<?php echo CActiveForm::fileField($model,'_'.$id); ?>
<?php endif; ?>